Returns first record displayed in the grid

<div class="definition">
    getFirst([index])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>index</td>
        <td><b>integer</b>, <i>(optional)</i> record index if not first</td>
    </tr>
    </table>
</div>
Returns string.

<h4>Description</h4>

This method return record displayed in the grid. If there is no local search, first
displayed record is the first record in <span class="property">.records</span> array. However, if local search is applied,
it is not always first.
<div style="height: 10px"></div>

After local search is applied, the ids of the records that match search criteria are stored in
<span class="property">.last.searchIds</span> array.

If you have a grid defined in the following way:
<textarea class="javascript">
let grid = new w2grid({
    name: 'grid',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%', editable: { type: 'text'} },
        { field: 'fname', text: 'First Name', size: '30%', editable: { type: 'text'} },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'Start Date', size: '120px' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    records: [
        { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' },
        { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' },
        { recid: 3, fname: 'Jin', lname: 'Franson', email: '--', sdate: '4/23/2012' },
        { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '5/3/2012' },
        { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
        { recid: 6, fname: 'Francis', lname: 'Gatos', email: 'vitali@gmail.com', sdate: '2/5/2012' }
    ]
});
</textarea>

You can get all the changed records:
<textarea class="javascript">
w2ui.grid.search('fname', 's');
console.log(w2ui.grid.getFirst());
</textarea>